home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Interactive Media Design Review 1999
/
Interactive Media Design Review 1999.iso
/
pc
/
Demos
/
Herois
/
Codigo.Cst
/
00054_Script_vaiPagina
< prev
next >
Wrap
Text File
|
1999-03-19
|
4KB
|
139 lines
on vaiPagina arqNum, saida
if arqNum = 8 then set arqNum = 7
-- <saida> indica para preparar saida padrao da pagina
if saida then
sendSprite(120,#comecaAnima)
updateStage
calculaPronde arqNum
sendAllSprites(#cleanSprite)
end if
-- Calcula em que parte do CD esta o filme e guarda em
-- <gDonde>
calculaDonde
-- Analogo
calculaPronde arqNum
if arqNum >= 10000 then
return vaiVerbete(arqNum, 1)
else if arqNum >= 1000 and arqNum < 1100 then
return vaiCriadores(arqNum)
else if arqNum >= 2000 and arqNum < 2010 then
return vaiMelhores(arqNum)
else if arqNum >= 1 and arqNum < 10 then
return vaiUniversos(arqNum)
else if arqNum = 0 then
end if
return false
end
-- Empilha local por onde se esta passando
on empilhaArq arqNum
-- Atualiza tabela de StepBack's
global gStepBack, gStepBackMax, gStepBackIni, gStepBackUlt
set anterior = gStepBackUlt - 1
if anterior = 0 then set anterior = gStepBackMax
set anterior = getAt(gStepBack,anterior)
if gStepBackUlt = gStepBackIni or anterior <> arqNum then
setAt(gStepBack, gStepBackUlt, arqNum)
set gStepBackUlt = gStepBackUlt + 1
if gStepBackUlt = gStepBackMax + 1 then set gStepBackUlt = 1
if gStepBackUlt = gStepBackIni then
-- Estourou buffer, incrementa ini
set gStepBackIni = gStepBackIni + 1
if gStepBackIni = gStepBackMax + 1 then set gStepBackIni = 1
end if
end if
end
-- Descobre pagina atual pela pilha
on paginaAtual
global gStepBack, gStepBackMax, gStepBackIni, gStepBackUlt
set anterior = gStepBackUlt - 1
if anterior = 0 then set anterior = gStepBackMax
set anterior = getAt(gStepBack,anterior)
return anterior
end
-- Retorna arqNum desempilhado, ou -1 se vazio
on desempilhaArq
global gStepBack, gStepBackMax, gStepBackIni, gStepBackUlt
if gStepBackIni = gStepBackUlt then return -1
set gStepBackUlt = gStepBackUlt - 1
if gStepBackUlt = 0 then set gStepBackUlt = gStepBackMax
return getAt(gStepBack, gStepBackUlt)
end
-- Descobre se tela atual nao e' uma "pagina"
on testaPagina
set f = the frame
return not (¼
(f = marker("Universo")) or ¼
(f >= marker("Criadores") and f < marker("FimCriadores") and ¼
the visibility of sprite 12 = false) or¼
(f = marker("Melhores Momentos")) or¼
(f >= marker("JapasFotos") and f <= marker("Fim") ) or¼
(f = marker("nois")) ¼
)
end
-- Faz volta
on fazBack
if testaPagina() then
set tmp = desempilhaArq()
else
set tmp = -1
end if
set arqNum = desempilhaArq()
if arqNum = -1 then
if tmp <> -1 then empilhaArq tmp
return -1
else
vaiPagina arqNum, true
return arqNum
end if
end
-- Descobre em que parte do CD estamos: Importante
-- pois alguns sprites nao devem ser desligados
-- se viemos da mesma parte
on calculaDonde
-- De onde vem o frame atual
global gDonde -- abertura(0), universos(1), momentos(1000), criadores(2000), verbetes(10000)
set x = the frame
if x >= marker("Menu") then
set gDonde = 0
else if x >= marker("Melhores Momentos") then
set gDonde = 2000
else if x >= marker("Verbetes") then
set gDonde = 10000
else if x >= marker("Criadores") then
set gDonde = 1000
else if x >= marker("Universos") then
set gDonde = 1
else
set gDonde = -1
end if
end
on calculaPronde arqNum
global gPronde
if arqNum >= 10000 then
set gPronde = 10000
else if arqNum >= 1000 and arqNum < 1100 then
set gPronde = 1000
else if arqNum >= 2000 and arqNum < 2010 then
set gPronde = 2000
else if arqNum >= 1 and arqNum < 10 then
set gPronde = 1
else if arqNum = 0 then
set gPronde = 0
end if
return false
end